<!DOCTYPE html>
<html>
<head>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
</head>
<script>
  var t_css = async_test(
    "SRI with CSS with successful revalidation shouldn't crash");
  function revalidate_css() {
    var link = document.createElement('link');
    link.setAttribute('rel', 'stylesheet');
    link.integrity="sha256-tbudgBSg+bHWHiHnlteNzN8TUvI80ygS9IULh4rklEw=";
    link.onload = t_css.step_func_done();
    link.onerror = t_css.unreached_func('Second request should pass');
    link.href =
      "../../cache/resources/etag.php?type=css&empty-after-revalidate-css";
    document.head.appendChild(link);
  }
</script>
<link
  href="../../cache/resources/etag.php?type=css&empty-after-revalidate-css"
  rel="stylesheet"
  integrity="sha256-tbudgBSg+bHWHiHnlteNzN8TUvI80ygS9IULh4rklEw="
  onload="t_css.step_timeout(revalidate_css, 0)"
  onerror="t_css.unreached_func('First request should pass')()"
>
</html>
